package com.lyf.os.practice.nju;

import java.util.concurrent.TimeUnit;

/**
 * @author LYF
 * @date 2022/7/12
 */
public class ThreadDemo {
    public static void main(String[] args) {
        new Thread(()->{
            while (true){
                System.out.println("exec....");
                try {
                    TimeUnit.SECONDS.sleep(1);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        },"A").start();
        new Thread(()->{
            while (true){
                System.out.println("exec....");
                try {
                    TimeUnit.SECONDS.sleep(1);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        },"B").start();
    }
}
